package com.hdax.dm.feign.item;

import com.hdax.dm.entity.item.DmItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "dm-item-provider")
public interface DmItemFeign {

    /**
     * 查询分类信息
     * @param itemType1Id
     * @return
     */
    @PostMapping(path = "/item/hotItems")
    List<DmItem> hotItems(@RequestParam("itemType1Id")Long itemType1Id);

    /**
     * 楼层热门商品
     * @param itemType1Id
     * @return
     */
    @PostMapping(path = "/item/getFloorOrder")
    List<DmItem> getFloorOrder(@RequestParam("itemType1Id")Long itemType1Id,
                               @RequestParam("limit")Long limit);

    /**
     * 根据分类查询所有商品
     * @param itemType1Id
     * @return
     */
    @RequestMapping(path = "/item/findItemByType")
    List<DmItem> findItemByType(@RequestParam("itemType1Id")Long itemType1Id);

    /**
     * 查询商品信息
     * @param itemId
     * @return
     */
    @PostMapping(path = "/item/getItems")
    DmItem getItems(@RequestParam("itemId")Long itemId);

    /**
     * 查询今日推荐
     * @return
     */
    @PostMapping(path = "/item/recommend")
    List<DmItem> recommend();

    /**
     * 查询即将开售
     * @return
     */
    @PostMapping(path = "/item/sell")
    List<DmItem> sell();

    @RequestMapping(path = "/item/byAgeGroup")
    List<DmItem> byAgeGroup(@RequestParam("ageGroup")Long ageGroup);
}
